const  colorList= ['#02C9FF','#FCBF05', '#03E579', '#D068FB', '#FF82D8', '#03DDCD'];
// 倒叙
colorList.reverse();

export default function (unit) {
    return JSON.parse(JSON.stringify({
        grid: {
            top: 32,
            bottom: 30,
            right:0,
            left:0,
            containLabel: true
        },
        title: {
            text: unit || `合计(个)`,
            subtext: '0',
            left: 'center',
            top: '29%', //top待调整
            textStyle: {
                color: '#828B94',
                fontSize: 12,
            },
            subtextStyle: {
                color: '#030000',
                fontSize: 18,
                top: 'center'
            },
        },
        legend: {
            orient: 'horizontal',
            icon: 'circle',
            bottom: 20,
            itemWidth: 10,
            itemHeight: 10,
            x: 'center',
            textStyle: {
                color: '#000000'
            },
            itemGap: 20,
        },
        series: [
            // 主要展示层的
            {
                radius: ['30%', '52%'],
                center: ['50%', '36%'],
                type: 'pie',
                itemStyle: {
                    borderWidth: 4,
                    borderColor: "#fff",
                },
                hoverAnimation: false, //鼠标移入变大
                animation: false,
                labelLine: {
                    show: false,
                },
                label: {
                    show: false
                },
                data: []
            },
            // 边框的设置
            {
                radius: ["57%", "54%"],
                center: ['50%', '36%'],
                type: 'pie',
                label:{
                    normal: {
                        formatter: '{d}%\n',
                        padding: [0, -30, 25, -30],
                        color: 'inherit',
                        fontSize: 10
                    },
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 20,
                        length2: 20,
                        lineStyle: {
                            color: '#D7D7D7'
                        },
                    },
                    color: "#000",
                    emphasis: {
                        show: true
                    }
                },
                hoverAnimation: false, //鼠标移入变大
                animation: false,
                tooltip: {
                    show: false
                },
                itemStyle: {
                    borderWidth: 3,
                    color: '#fff',
                    borderColor: "#fff",
                },
                data: [{
                    value: 1,
                }],
            },
            {
                zindex: 100,
                radius: "27%",
                center: ['50%', '36%'],
                type: 'pie',
                label:{
                    show: false
                },
                labelLine: {
                    show: false
                },
                itemStyle: {
                    color: '#DFEFFE'
                },
                data: [{
                    value: 1,
                }],
            }
        ]
    }))
}
